import Router from './Router'

export function getCurrentPageInfo() {
  const stackPages = getCurrentPages()

  let result

  if (stackPages && stackPages.length > 0) {
    const currentPage = stackPages[stackPages.length - 1]

    result = {
      fullPath: Router.genUrl(currentPage.route, currentPage.options),
      route: currentPage.route,
      options: currentPage.options
    }
  }
  return result
}